<template>
  <div class="container">
    <h1 style="color:rgb(154 126 255);font-family: fangsong;font-weight: bold;">这里是一个全能的查询网站你可以在这里找到各种各样的花里胡哨的内容，努力探索吧</h1>
    <div style="margin-top:20px;">
      <el-link style="font-size:20px;font-family: fangsong;font-weight: bold;" href="http://www.haoge.run" type="primary">这里是我的博客，感兴趣或者有意见可以进来逛逛，如果想添加一些什么功能也可以告诉我</el-link>
    </div>
    <el-dialog
      title=""
      :visible.sync="dialogVisible"
      width="width"
      center>
      <div class="userInfoView">
        <span>现在是{{userInfo.location}}时间{{userInfo.time}}</span>
        <span>欢迎来自{{userInfo.location}}的朋友</span>
        <span>今天是{{userInfo.week}},天气{{userInfo.tq}},室外温度{{userInfo.wd}},风力是{{userInfo.fl}}.{{userInfo.tip}}</span>
        <span>您的浏览器是{{userInfo.browser}},版本是{{userInfo.browser_ver}},系统是{{userInfo.system}}</span>
        <span>您的ip地址是{{userInfo.ip}}</span>
      </div>
      <div slot="footer">
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {getUserInfo} from '@/common/common';
export default {
  data() {
    return {
      userInfo:{},
      dialogVisible:false
    }
  },
  mounted(){
    let params = {};
    getUserInfo(params).then(res=>{
      if(res.status == 200){
        let userInfo = JSON.parse(res.data.body);
        this.userInfo = userInfo;
        this.dialogVisible = true;
      }
    })
  }
}
</script>

<style>
.container {
  width: 100%;
  padding: 1%;
  margin: 0 auto;
}

.userInfoView {
  display:flex;
  flex-direction:column;
}

.userInfoView > span {
  margin-top: 10px;
  font-size:16px;
  font-weight: bold;
}
</style>
